<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<!--#    Copyright 2011 Tri-County Electric Cooperative, St. Matthews, South Carolina
#    This file is part of COOPIP.
#    COOPIP is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#    COOPIP is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#    You should have received a copy of the GNU General Public License
#    along with COOPIP.  If not, see <http://www.gnu.org/licenses/>.-->

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>Dispatch Board</title>
  <link rel="stylesheet" type="text/css" href="/style.css" />
  <style type="text/css">
    html,body{
        margin:0;
        padding:0;
    }
  </style>
</head>
<body bgcolor="tan">
  <div id="dispatchmap_noninteractive_wrapper">
      <img id="dispatchmap_noninteractive_background", src="/dispatchmapbackground.png">
      <img id="dispatchmap_noninteractive_overlay", src="/dispatchmapoverlay.png">
      <img id="dispatchmap_noninteractive_legend", src="/cgi-bin/mapserv?mode=legend&map=/opt/coopip/mapserver/dispatchdisplay.map">
  </div>

  <script src="/jquery.js"></script>
  <script>
      function reloadExternal() {
          //single connection limit more useful during testing, when intervals are shorter
          if (RequestInProgress != true){
              RequestInProgress = true;
              var datetime = new Date().toString();
              //this loads the image by force-changing the source each time; if image fails, no recovery.
              $("#dispatchmap_noninteractive_background").attr("src", "/dispatchmapbackground.png?" + datetime);
              $("#dispatchmap_noninteractive_overlay").attr("src", "/dispatchmapoverlay.png?" + datetime);
              RequestInProgress = false;
          }
      }

      function delayThenReload() {
          window.setInterval(reloadExternal, 15000);
      }

      //default for .load() timeout is 0, change in global settings
      var RequestInProgress = false;
      reloadExternal();
      $(window).load(delayThenReload); 
  </script>

</body>
</html>
